#ifndef IGAMEOBJECT_H
#define IGAMEOBJECT_H

/*
IGameObject virtual base class for most game objects.
*/

#include "trGameProperty.h"
#include "trGameWorld.h"
#include "trEventNode.h"

namespace tetra
{

class trGameObject;
class trGameWorld;


//typedef irr::core::array<trGameProperty<void> > trGamePropertyArray;

class trGameObject : public trEventNode
{

    trGameWorld* game_world; //game world this is contained within

    trGamePropertyArray* properties;

    //! Position of stroke
    bool strokeP;

    //! The rod pushes this object...
    trGameObject* rod;

    //! ...this pushes its cranks.
    trGameObjectArray* crank;

public:

    //! Default constructor
    trGameObject();

    //! Constructor
    trGameObject( trGameObject* rod_, trGameObjectArray* crank_ );

    //! Copy constructor
    trGameObject( trGameObject* object ):
    strokeP( object->getStrokeP() ), rod( object->rod ), crank( object->crank ) {};

    //! Destructor
    virtual ~trGameObject() =0;

    //! Returns the stroke position
    virtual bool getStrokeP(){ return strokeP; };

    //! Add property


    //! Sets the parent 'rod'
    virtual void setRod( trGameObject* new_rod ) { rod =new_rod; };

    //! Adds a child 'crank'
    virtual void addCrank( trGameObject* new_crank ) { crank->push_back( new_crank ); };

    //! Run logic tik.
    virtual void stroke() =0;

};

}; //end namespace tetra

#endif // IGAMEOBJECT_H
